package com.rajaev.dtu.tractor.infrastructure.security;

/**
 * @Created with IDEA
 * @author: tianjie
 * @Date:2019/5/28
 * @Time:17:24
 */
public class UserContextHolder {

    private static ThreadLocal<String> threadLocal = new ThreadLocal<>();

    public static void setLoginUser(String loginName){
        threadLocal.set(loginName);
    }
    public static void removeLoginUser(){
        threadLocal.remove();
    }

    public static String getLoginUserName(){
        return threadLocal.get();
    }
}
